package org.example.config;


import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class MqConfig {
    @Bean
    public MessageConverter messageConverter() {
        // 显式配置JSON转换，并设置Content-Type为application/json
        Jackson2JsonMessageConverter converter = new Jackson2JsonMessageConverter();
        converter.setAssumeSupportedContentType(false); // 强制使用JSON
        return converter;
    }
}
